package define;

public enum CharSet 
{
	E_ANS_CS("asc", "US-ASCII"),
	E_UTF8_CS("utf8", "UTF-8"),
	E_UTF16_LE_CS("utf16le", "UTF-16LE"),
	E_UTF16_BE_CS("utf16be", "UTF-16BE"),
	E_UTF16("utf16", "UTF-16"),
	;
	
	private String m_text;
	private String m_charset;
	
	private CharSet(String text, String charset)
	{
		m_text = text;
		m_charset = charset;
	}
	
	public static CharSet getCharSet(String text)
	{
		text = text.toLowerCase();
		for(CharSet temp: CharSet.values())
		{
			if(temp.m_text.compareTo(text) == 0)
			{
				return temp;
			}
		}
		return null;
	}
	
	public String getCharset()
	{
		return m_charset;
	}
}
